package com.lmk.feign;

import com.lmk.domain.Store;
import com.lmk.util.AjaxResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(name="store-service",fallbackFactory = StoreServiceFallbackFactory.class)
@RequestMapping("/store")
public interface StoreServices {

    // 查询所有
    @GetMapping("/getAll")
    List<Store> getAll();

    // 查询单个
    @GetMapping("/getById/{id}")
    Store getById(@PathVariable("id") Long id);

    // 添加或修改
    @PostMapping("/addorupdate")
    AjaxResult addorupdate(@RequestBody Store store);

    // 删除
    @DeleteMapping("/del/{id}")
   AjaxResult del(@PathVariable("id") Long id);

}
